class Vue{
    constructor(options){
        this.el=options.el; //this.el 为el的值
        this.data = options.data; //同上
        this.compile();
    }
}
Vue.prototype.compile = function(){
    // console.log(this.el);
    let ele = document.querySelector(this.el);
    this.setCompile(ele)
}
Vue.prototype.setCompile = function(ele){
    this.child = ele.childNodes
    this.child.forEach(node => {
        if(node.nodeType===3){ //先让第一层的非节点筛选出来然后找到双括号
            //通过正则去筛选
            this.reg = /{{\s*([^{}\s]+)\s*}}/g;
            this.content = node.nodeValue 
            if(this.reg.test(this.content)){
                // console.log(this.content);//
                this.$1=RegExp.$1;
                // console.log(this.$1);
                node.nodeValue=node.nodeValue.replace(this.reg,this.data[this.$1]);
            }
        }else if(node.nodeType===1){
            //是元素节点就接着循环
            this.setCompile(node)
        }
    });
}

class Proxy{
    constructor(){
        this.session={};
    }
}